package com.shop.api.feign;

import com.shop.Result.LdbzResult;
import com.shop.pojo.LdbzAdminAuth;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "shop-service-admin")
public interface AdminAuthFeign {

    //获取用户
    @RequestMapping(value = "/admin/auth/service/selectUserByRole",method = RequestMethod.GET)
    LdbzResult selectUserByRole(@RequestParam("roleId") Long roleId,@RequestParam("page") int page,@RequestParam("limit")int limit,@RequestParam("realName")String realName);

    //获取资源
    @RequestMapping(value = "/admin/auth/service/selectMenuByRole",method = RequestMethod.GET)
    LdbzResult selectMenuByRole(@RequestParam("roleId") Long roleId,@RequestParam("page") int page,@RequestParam("limit")int limit,@RequestParam("menuName")String menuName);

    //删除角色下的用户
    @RequestMapping(value = "/admin/auth/service/deleteByUser",method = RequestMethod.GET)
    LdbzResult deleteByUser(@RequestParam("userId") Long userId,@RequestParam("roleId") Long roleId);

    //删除角色下的资源
    @RequestMapping(value = "/admin/auth/service/deleteByMenu",method = RequestMethod.GET)
    LdbzResult deleteByMenu(@RequestParam("menuId") Long menuId,@RequestParam("roleId") Long roleId);

    //角色分配用户
    @RequestMapping(value = "/admin/auth/service/insertByUser",method = RequestMethod.GET)
    LdbzResult insertByUser(@RequestParam("entity") LdbzAdminAuth entity);

    //角色分配资源
    @RequestMapping(value = "/admin/auth/service/insertByMenu",method = RequestMethod.GET)
    LdbzResult insertByMenu(@RequestParam("entity") LdbzAdminAuth entity);

    //获取用户信息
    @RequestMapping(value = "/admin/auth/service/getUserByNameOrAccount",method = RequestMethod.GET)
    LdbzResult getUserByNameOrAccount(@RequestParam("queryKry") String queryKry);

    //获取资源信息
    @RequestMapping(value = "/admin/auth/service/getResByNameOrUrl",method = RequestMethod.GET)
    LdbzResult getResByNameOrUrl(@RequestParam("queryKey") String queryKey);
}
